package cn.hinglo.gameclaw.admin.action;

import cn.hinglo.gameclaw.admin.service.FeedBackService;
import cn.hinglo.gameclaw.data.controller.BaseController;
import cn.hinglo.gameclaw.data.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @createTime: 2018/1/5
 * @author: HingLo
 * @description: 反馈信息管理
 */
@RestController
@RequestMapping("admin/f/")
public class FeedBackAction extends BaseController {

    private final FeedBackService feedBackService;

    @Autowired
    public FeedBackAction(FeedBackService feedBackService) {
        this.feedBackService = feedBackService;
    }

    /**
     * 查询反馈信息
     *
     * @param status 处理状态
     * @param type   反馈类型，房间反馈与软件反馈
     * @return 反馈列表
     */
    @GetMapping("list")
    public Result listFeedBack(boolean status, int type) {
        return feedBackService.listFeedBackService(status, type);
    }

    /**
     * 修改阅读状态
     *
     * @param id 反馈的唯一Id
     * @return 操作结果
     */
    @PutMapping("update")
    public Result updateFeedBack(String id) {
        return feedBackService.updateFeedBackService(id);
    }

    /**
     * 删除反馈信息
     *
     * @param id 反馈信息的唯一ID
     * @return 操作结果
     */
    @DeleteMapping("delete")
    public Result deleteFeedBack(String id) {
        return feedBackService.deleteFeedBackService(id);
    }

}
